% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/state_from_latlon.R
\name{state_from_latlon}
\alias{state_from_latlon}
\title{Find what state is where each point is located}
\usage{
state_from_latlon(lat, lon)
}
\arguments{
\item{lat}{latitudes vector}

\item{lon}{longitudes vector}
}
\value{
Returns data.frame: ST, statename, FIPS.ST, REGION, n
as many rows as elements in lat or lon
}
\description{
Takes 3 seconds to find state for 1k points, so a faster alternative would be useful
}
\examples{
 myprogram <- "CAMDBS" # 739 sites
 pts <- frs_from_program(myprogram)[ , .(lat, lon, REGISTRY_ID,  PRIMARY_NAME)]
 # add a column with State abbreviation
 pts[, ST := state_from_latlon(lat=lat, lon = lon)$ST]
 #map these points
 mapfast(pts[ST == 'TX',], radius = 1) # 1 miles radius circles

}
\seealso{
\link{states_shapefile} \code{\link[=get_blockpoints_in_shape]{get_blockpoints_in_shape()}} \code{\link[=state_from_sitetable]{state_from_sitetable()}}
}
